# -*- coding: utf-8 -*-
# author yzs
# date 2019-01-01
#
# 非递归快排
# Description
# 快速排序的核心思想是使用元素的值对数组进行划分。实现其非递归方案。
# Input
# 输入的每一行表示一个元素为正整数的数组，所有值用空格隔开，第一个值为数值长度，其余为数组元素值
# Output
# 输出每一行为排序结果，用空格隔开，末尾不要空格
# Sample Input 1
# 13 24 3 56 34 3 78 12 29 49 84 51 9 100
# Sample Output 1
# 3 3 9 12 24 29 34 49 51 56 78 84 100


def quick_sort(data):
    if len(data) < 2:
        return data
    stack = []
    stack.append(len(data) - 1)
    stack.append(0)
    while stack:
        low = stack.pop()
        high = stack.pop()
        index = partition(data, low, high)
        if low < index - 1:
            stack.append(index - 1)
            stack.append(low)
        if high > index + 1:
            stack.append(high)
            stack.append(index + 1)


def partition(data, low, high):
    pivot = data[low]
    while low < high:
        while low < high and data[high] >= pivot:
            high -= 1
        data[low] = data[high]
        while low < high and data[low] <= pivot:
            low += 1
        data[high] = data[low]
    data[low] = pivot
    return low


while True:
    try:
        data = list(map(int, input().strip().split()))
        num, data = data[0], data[1:data[0] + 1]
        result = [0] * num
        quick_sort(data)
        print(" ".join(str(i) for i in data))
    except EOFError:
        break
